* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f6fa;
}

.container {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏样式 */
.sidebar {
    width: 250px;
    background-color: #2c3e50;
    color: white;
    padding: 20px 0;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.sidebar h2 {
    padding: 0 20px 20px;
    border-bottom: 1px solid #34495e;
    margin-bottom: 20px;
}

.menu-item {
    padding: 15px 20px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.menu-item i {
    margin-right: 10px;
    width: 20px;
}

.menu-item:hover {
    background-color: #34495e;
}

.menu-item.active {
    background-color: #3498db;
}

/* 主内容区样式 */
.main-content {
    flex: 1;
    padding: 20px;
    background-color: #f5f6fa;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.header button {
    padding: 10px 20px;
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.header button:hover {
    background-color: #c0392b;
}

/* 统计卡片样式 */
.stat-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.stat-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.stat-header i {
    font-size: 24px;
    color: #3498db;
    margin-right: 10px;
}

.stat-content {
    text-align: center;
}

.stat-number {
    font-size: 36px;
    font-weight: bold;
    color: #2c3e50;
}

.stat-label {
    color: #7f8c8d;
    margin-top: 5px;
}

/* 表单样式 */
.form-container {
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    margin-top: 20px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

/* 按钮样式 */
.btn {
    padding: 8px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    margin: 0 5px;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-danger {
    background-color: #e74c3c;
    color: white;
}

.btn-success {
    background-color: #2ecc71;
    color: white;
}

.btn:hover {
    opacity: 0.9;
}

/* 表格样式 */
table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

th, td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

th {
    background-color: #f8f9fa;
    font-weight: 600;
}

tr:hover {
    background-color: #f8f9fa;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 返回按样式 */
.back-btn {
    color: #2c3e50;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    border-radius: 5px;
    transition: all 0.3s;
    font-size: 14px;
    background-color: #f8f9fa;
}

.back-btn:hover {
    background-color: #e9ecef;
    color: #3498db;
}

.back-btn i {
    font-size: 16px;
}

/* 角色标签样式 */
.badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.badge-admin {
    background-color: #3498db;
    color: white;
}

.badge-user {
    background-color: #95a5a6;
    color: white;
}

.sidebar-home {
    padding: 20px;
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: bold;
    border-bottom: 1px solid #34495e;
    margin-bottom: 20px;
    transition: all 0.3s;
}

.sidebar-home:hover {
    background-color: #34495e;
}

.sidebar-home i {
    font-size: 20px;
}

/* 富文本编辑器中的图片样式 */
.rich-editor img {
    max-width: 50%; /* 修改图片最大宽度为编辑器的50% */
    height: auto;
    margin: 10px auto; /* 居中显示 */
    display: block; /* 确保图片独占一行 */
    border-radius: 5px;
}

.image-wrapper {
    position: relative;
    display: block; /* 改为块级元素 */
    margin: 10px auto; /* 居中显示 */
    width: 50%; /* 与图片宽度一致 */
}

.image-wrapper img {
    width: 100%; /* 图片填充包装器 */
    max-width: 100%;
    height: auto;
    display: block;
}

/* 添加图片尺寸控制按钮 */
.image-tools {
    position: absolute;
    top: 5px;
    right: 5px;
    display: none;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 3px;
    padding: 5px;
    gap: 5px;
}

.image-wrapper:hover .image-tools {
    display: flex;
}

.image-tools button {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 3px 6px;
    border-radius: 3px;
    font-size: 12px;
}

.image-tools button:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    padding: 20px;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.close-btn {
    cursor: pointer;
    padding: 5px;
    font-size: 20px;
    color: #7f8c8d;
    transition: color 0.3s;
}

.close-btn:hover {
    color: #e74c3c;
}

.form-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

.recent-logins {
    text-align: left;
    padding: 10px;
}

.login-record {
    padding: 8px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.login-record:last-child {
    border-bottom: none;
}

.login-username {
    color: #2c3e50;
    font-weight: 500;
}

.login-time {
    color: #7f8c8d;
    font-size: 0.9em;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
    padding: 10px;
}

.pagination button {
    padding: 8px 12px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.pagination button:hover {
    background: #f5f6fa;
}

.pagination button.active {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

.pagination button:disabled {
    background: #f5f6fa;
    color: #bdc3c7;
    cursor: not-allowed;
}

.recent-logins {
    max-height: 400px;
    overflow-y: auto;
}

.login-record {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid #eee;
}

.login-record:last-child {
    border-bottom: none;
}

.login-username {
    color: #2c3e50;
    font-weight: 500;
}

.login-time {
    color: #7f8c8d;
    font-size: 0.9em;
}

/* Toast 提示框样式 */
.toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
}

.toast {
    background: white;
    border-radius: 8px;
    padding: 15px 25px;
    margin-bottom: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s ease, fadeOut 0.3s ease 2.7s;
    max-width: 350px;
}

.toast.success {
    border-left: 4px solid #2ecc71;
}

.toast.error {
    border-left: 4px solid #e74c3c;
}

.toast.info {
    border-left: 4px solid #3498db;
}

.toast-icon {
    font-size: 20px;
}

.toast.success .toast-icon {
    color: #2ecc71;
}

.toast.error .toast-icon {
    color: #e74c3c;
}

.toast.info .toast-icon {
    color: #3498db;
}

.toast-message {
    color: #2c3e50;
    font-size: 14px;
    flex: 1;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}